#ifndef NR_CLIENT_DEVICE_TREE_H
#define NR_CLIENT_DEVICE_TREE_H


#include "nr_client_deviceTreeWidgetItem.h"

class SetTreewidget : public QTreeWidget
{
	Q_OBJECT
public:
	SetTreewidget(nr_device_item_server &item_server, QWidget *parent = 0);
	~SetTreewidget();

    //nr_object_manager& object_manager() {return m_object_manager;}
    nr_device_item_server& device_item_server(){return m_item_server;}


    //for test
    void SetTree();


protected:
    //build the tree with deviceItems, it's called in this class construct
    bool set_device_tree();
    bool set_deviceitemserver_topnode();
    bool set_devicegroup_treenode(DeviceTreeWidgetItem &father_item, nr_device_group &device_group);
    bool set_deviceitem_treenode(DeviceTreeWidgetItem &father_item, nr_device_item &device_item);
    bool set_property_tree_node(DeviceTreeWidgetItem &father_item, nr_device_property &device_property);

private:
    //nr_object_manager &m_object_manager;
    nr_device_item_server &m_item_server;
};


#endif // TREEANDSUBWINDOW_H
